<template>
  <div>
    <Box>
      <h2 v-if="item !== 'Zh'" style="margin: 10px 15px" slot="title">简要情况</h2>
      <h2 v-else style="margin: 10px 15px" slot="title">事件概述</h2>
      <div slot="box">
        <p style="font-size: 1.1rem" v-if="this.Midata.eventOverview">{{ this.Midata.eventOverview }}</p>
        <p style="font-size: 1.1rem" v-if="this.Midata.caseSituation">{{ this.Midata.caseSituation }}</p>
        <p style="font-size: 1.1rem" v-if="this.Midata.situation">{{ this.Midata.situation }}</p>
        <div style="border-top: 1px solid silver;display: flex;padding: 15px" v-if="file !== []">
<!--          {{this.file}}-->
<!--          <a-icon type="file" />-->
          <div>附件下载 ：</div>
          <div>
            <div style="cursor: pointer" v-for="(item,index) of this.file" :key="index" @click="download(item.url)">
              <a-icon type="file" />
              <a style="color: #808080;margin-left: 5px" :href="item.url">{{item.fileName}}</a>
            </div>
          </div>
        </div>
      </div>
    </Box>
  </div>
</template>

<script>
import Box from '@/views/xlgc/Box/index'
import { resultFile } from '@/api/xlgc/lawCase'
export default {
  name: 'SummaryM',
  components: { Box },
  props: {
    Midata: Object,
    item:String,
    type:String,
    id:String
  },
  data(){
    return {
      file: undefined
    }
  },
  mounted() {
    console.log(this.Midata)
    this.getResultFile({id:this.id,type:this.type})
  },
  methods:{
    download(url){
      console.log(url)
      // window.open(url+'')
      // Window.location.href = url
    },
    getResultFile(val){
      resultFile(val).then(res =>{
        console.log(res)
        this.file = res.result
      }).catch(error => {
        // this.file = error
        this.$message.error('附件加载失败')
      })
    }
  }
}
</script>

<style scoped>

</style>
